home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / asppw112 / sendmail.asp < prev   
Text File  |  1999-01-07  |  3KB  |  84 lines

  1. <HTML><BODY>
  2. <%
  3.     '
  4.     ' This file is provided as part of  ASP Power Widgets Samples
  5.     '
  6.     ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
  7.     ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  8.     ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  9.     ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
  10.     ' PURPOSE.
  11.  
  12.     ' Copyright 1997-1998. All rights reserved.
  13.     ' Dalun Software Inc. ASP Power Widgets
  14.     ' http://www.dalun.com
  15.     ' http://members.tripod.com/ActiveServerPage/
  16.  
  17.     ' MailMgt Object of ASPPW can send MIME 1.0 compliant mails using Base64 encoding.
  18.      
  19.     Set oMailMgt = Server.CreateObject("ASPPW.SMTP")
  20.     oMailMgt.SMTP="202.92.1.2"           'Change this to your smtp server.
  21.     oMailMgt.MailFrom="somebody@abc.com"
  22.  
  23.     oMailMgt.MailTo="urgentmail@yahoo.com"
  24.     'oMailMgt.MailTo="second_to@yahoo.com"
  25.     'oMailMgt.MailTo="third_to@yahoo.com"
  26.  
  27.     oMailMgt.MailCc ="first_cc@hotmail.com"
  28.     'oMailMgt.MailCc="second_cc@yahoo.com"
  29.     'oMailMgt.MailCc="third_cc@yahoo.com"
  30.  
  31.     oMailMgt.MailBcc ="first_bcc@yahoo.com"
  32.     'oMailMgt.MailBcc="second_bcc@yahoo.com"
  33.     'oMailMgt.MailBcc="third_bcc@yahoo.com"
  34.  
  35.     'You may specify Errors-to and Reply-To or not
  36.      oMailMgt.MailErrorsTo = "err@your_domain.com"
  37.      oMailMgt.MailReplyTo=  "urgentmail@yahoo.com"
  38.     
  39.     oMailMgt.MailSubject="Testing sendmail ASP object"
  40.  
  41.     oMailMgt.MailContent= "This is mail line 1."
  42.     oMailMgt.MailContent= "This is mail line 2."
  43.     oMailMgt.MailContent= "This is mail line 3."
  44.  
  45.     'MailMgt object now can read a file directly.
  46.     'oMailMgt.MailContent = oMailMgt.ReadFile("c:\manual.txt") 'This is line 4 ...
  47.  
  48.     'MailMgt object now can send attachments.
  49.     'oMailMgt.Attach = "c:\1.jpg"
  50.     'oMailMgt.Attach = "c:\laser.wav"
  51.  
  52.     'MailMgt object now can log mail events. Log file - sendmail.log
  53.     'stays with MailMgt.dll in a same directory
  54.  
  55.     oMailMgt.LogEvent = False 'true or false
  56.  
  57.     'Note: MailTo, MailCc, MailBcc, MailContent and MailAttachments are actually
  58.     'Visual Basic Collection objects.
  59.  
  60.     bReturnCode = oMailMgt.SendMail()
  61.     response.write "Return Code is: " + CStr(bReturnCode) + "<br>"
  62.  
  63.     if bReturnCode=false then
  64.         response.write  oMailMgt.GetLastErrDescription + "<br>"
  65.     end if
  66.     
  67.     'Note: After sending out a mail successfully, properties of
  68.     'MailTo, MailBcc, MailCc, MailSubject, MailContent would be
  69.     'cleared automatically.
  70.  
  71.     oMailMgt.MailTo="urgentmail@yahoo.com"
  72.     oMailMgt.MailSubject="Testing sendmail ASP object's resending"
  73.  
  74.     oMailMgt.MailContent= "This is mail line 3."
  75.     oMailMgt.MailContent= "This is mail line 2."
  76.     oMailMgt.MailContent= "This is mail line 1."
  77.  
  78.     bReturnCode = oMailMgt.SendMail()
  79.     response.write "Return Code is: "+ CStr(bReturnCode) + "<br>"
  80.  
  81.     set oMailMgt = Nothing 
  82. %>
  83. </BODY></HTML>
  84.